use "C:\Users\Andy baker\OneDrive - UCB-O365\My Documents\Research\Paper Book Networks\Chapter 2 Description\Data\Chapter 3 CIs.dta", clear

gen friend=round(mean, .01) if group=="friend"
gen family=round(mean, .01) if group=="family"
gen unspec=round(mean, .01) if group=="unspec"

*Figure 2.3
graph hbar family friend unspec, ///
over(election, relabel(5 "Mexico 2006{sub:{it:c}}" 4 "Mexico 2006{sub:{it:e}}" 1 "Brazil 2002" 2 "Brazil 2006" 3 "USA 1996") label(ticks labs(medsmall))) stack ///
ytitle("{bf:Egocentic Network Size}") legend(order(1 "Relative" 2 "Friend" 3 "Unspecified") row(1)) yscale(range(0 2.25))  ///
graphregion(color(white) margin(medlarge)) plotregion(lstyle(yxline) lcolor(black)) bar(1, color(black))  ///
bar(2, color(gs6)) bar(3, color(gs10))  ///
text(2.225 91.4 "2.12", size(medsmall)) text(2.195 70.7 "2.10", size(medsmall)) text(1.9 50.1 "1.80", size(medsmall)) text(1.86 29.4 "1.77", size(medsmall)) ///
text(1.569 8.7 "1.47", size(medsmall)) ///
text(1 91.4 "1.11", size(medsmall) color(white)) text(.96 70.7 "1.07", size(medsmall) color(white)) text(.69 50.1 "0.80", size(medsmall) color(white)) text(.765 29.4 "0.87", size(medsmall) color(white)) text(.61 8.7 "0.72", size(medsmall) color(white)) ///
text(1.95 91.4 "0.95", size(medsmall) color(white)) text(1.875 70.7 "0.91", size(medsmall) color(white)) text(1.57 50.1 "0.88", size(medsmall) color(white)) text(1.615 29.4 "0.85", size(medsmall) color(white)) text(1.33 8.7 "0.71", size(medsmall) color(white))

graph export "C:\Users\Andy baker\OneDrive - UCB-O365\My Documents\Research\Paper Book Networks\Chapter 2 Description\Figures\NetSizeBarGraph.tif", as(tif) replace
graph export "C:\Users\Andy baker\OneDrive - UCB-O365\My Documents\Research\Paper Book Networks\Publishers\Final Manuscript\Final Figures\BAR2_3.tif", as(tif) replace width(1500)
graph export "C:\Users\Andy baker\OneDrive - UCB-O365\My Documents\Research\Paper Book Networks\Publishers\Final Manuscript\Final Figures\BAR2_3.pdf", as(pdf) replace 
